<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	<title>加入投票</title>
	<link rel="stylesheet" href="common.css">
	<link rel="stylesheet" href="css/font-awesome.min.css">
	<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<style type="text/css">

body {
	padding:1em 0.8em;
	background:#FAEADB;
}

.head-img {
	width:50%;
	max-width:300px;
}

.codearea {display:table; width:100%;}
#poll-code {display:table-cell; width:auto;}
.codearea img {display:table-cell; width:3em; max-width:90%; background:gray;}

#join-btn {
	position:relative;
	text-align:center;
	top:-2em;
}

.circle-bg {
	position:;
	height:auto;
	width:100%;
	margin-top:3em;
	padding:0 0 1em 0;
 	background:#FBF7F1;
	border-radius:999px 999px 0 0;
}

</style>
 </head>
 <body>

<div id="container">
	<div class="card-shape">
		<div class="head-img"><img src="img/join-head.png"/></div>
		<h3 class="title">参加投票</h3>

		<p class="info">
			<span class="tooltip">房间号</span><br>
			<input type="text" id="poll-id" class="data" name="" placeholder="投票房间号">
		</p>
		<p class="info">
			<span class="tooltip">投票密码</span><br>
			<input type="text" id="poll-password" class="data" name="" placeholder="投票密码">
		</p>
		<p class="info">
			<span class="tooltip"></span><br>
			<input type="text" id="poll-code" class="data" name="" placeholder="右侧验证码">
			<img>
		</p>

		<div class="circle-bg">
			<div id="join-btn" onclick="jumpPage();">
				<span class="button circle-btn"><i class="fa fa-sign-in"></i></span><br>
				<span class="circle-label">加入投票</span>
			</div>
		</div>
	</div>
</div>


<script type="text/javascript">

function jumpPage(){
	var roomid = document.getElementById('poll-id').value;
	var pwd = document.getElementById('poll-password').value;
	if(roomid=='' || pwd==''){
		alert('请完整填写');
	}else{
		url = location.href;
		url = url.substring(0,url.lastIndexOf('/'))+'/poll.htm#'+roomid+'@'+pwd;
		location.assign(url);
	}
}

/*
function submitCall(){
	var pollid = document.getElementById('poll-id').value;
	var pw = document.getElementById('poll-password').value;
	if(pollid=='' || pw==''){
		//Show error
		alert('请完整填写');
	}else{
		sendData();
	}
}


function sendData(){
	url = '';
	var dataobj = {};
	dataobj['id'] = document.getElementById('poll-id').value;
	dataobj['password'] = document.getElementById('poll-password').value;
	//console.log(dataobj);
	postJSON(url,data,sendCallback);
}

function sendCallback(data,status){
	alert('ok');
}
*/
</script>


 </body>
</html>